(pos_visible_p): Take into account that CHARPOS maybe
authorGerd Moellmann <gerd@gnu.org>
Tue, 2 Jan 2001 12:10:57 +0000 (12:10 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 2 Jan 2001 12:10:57 +0000 (12:10 +0000)
in or at the start of invisible text.

src/xdisp.c

index ed98ced48a28a41f34ff36b207ef227d34c2b8ff..c1b312f1a42cacb8456b48de361bc62b189f391e 100644 (file)
@@ -1012,8 +1012,9 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p)
   start_display (&it, w, top);
   move_it_to (&it, charpos, 0, it.last_visible_y, -1,
              MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
-  
-  if (IT_CHARPOS (it) == charpos)
+
+  /* Note that we may overshoot because of invisible text.  */
+  if (IT_CHARPOS (it) >= charpos)
     {
       int line_height, line_bottom_y;
       int line_top_y = it.current_y;